<template>
    <div class="application-container">
        <component :is="layout"></component>
    </div>
</template>
<script>
export default {
    computed: {
        layout(){
            return this.$route.meta.layout || 'MyPage'
        },
        menu(){
            return this.$store.getters['common/menuList']
        }
    },
    watch: {
        menu(val) {
            let menuList = val.filter(it => !!it.path)
            let routes = menuList.map(it => ({path: it.path, component: (() => import('.' + it.path))}))
            this.$router.addRoutes(routes)

        }
    }
}
</script>